<?php
/**
 * 调用QQ的会员信息
 */
require_once(dirname(__FILE__)."/../includes/class.qq.api/qqConnectAPI.php");
$qc = new QC();
//获取QQ的信息
$user_data = $qc->get_info();
$user_message=$user_data['data'];


//真实姓名
$dataArray['realname']=$user_message['nick'];
//昵称
$dataArray['ncname']=$user_message['nick'];
//0女 1男 2未知 腾讯登录用户性别（1：男； 2：女； 3：未知）。 
$dataArray['sex']=$user_message['sex']=="3"?2:($user_message['sex']=="1"?1:0);
//头像
$dataArray['logo']=$user_message['head']."/";
//地址
$dataArray['address']=$user_message['location'];
//生日
$dataArray['birthday']=($user_message['birth_year']?$user_message['birth_year']."-":"0000-").($user_message['birth_month']?$user_message['birth_month']."-":"00-").($user_message['birth_day']?$user_message['birth_day']:"00");

//QQ首次绑定
if(isset($qq_first_bind)){
	$return_page_url="./tools/oauth/index.php";
	
	$results_uid_query = $db->query("SHOW TABLE status LIKE '{$tbprefix}user'");
	$insert_new_uid = $db->auto_id($results_uid_query);	//用于获取自动增长的会员uid
	
	//注册会员名
	$register_user=$user_message['name']."_".$insert_new_uid;
	//输入的密码
	$register_pwd_input=$pwdresetting;
	//确认密码
	$register_pwd_confirm_input=$pwdresetting;
	//注册邮箱
	$register_email=empty($user_message['email'])?"initial".$insert_new_uid."@qq.com":$user_message['email'];
	//加密密码
	$register_pwd=md5($pwdresetting.$pwdconstant);
	
	//注册绑定
	include_once (dirname(__FILE__)."/register_bind_do.php");
}

?>